#include <iostream>
#include <fstream>
#include <string>
using namespace std;

//#define READ_FILE

int main()
{
#ifdef READ_FILE
	ifstream in("1099.input");
	if (!in) { in.open("../1099.input"); }
#else
	#define in cin
#endif

	string line;
	string str;
	while (in >> str)
	{
		if (str == "<br>")
		{
			if (line.length() > 0) { cout << line; }
			cout << endl;
			line = "";
		}
		else if (str == "<hr>")
		{
			if (line.length() > 0) { cout << line << endl;}
			cout << "--------------------------------------------------------------------------------" << endl;
			line = "";
		}
		else
		{
			if (line.length() + str.length() + 1 > 80)
			{
				cout << line << endl;
				line = "";
			}
			if (line.length() > 0) { line.append(" "); }
			line.append(str);
		}
	}
	
	if (line.length() > 0) { cout << line << endl; }
	
	return 0;
}